package icu.feigroup.domain.trade.adapter.repository;

import icu.feigroup.domain.trade.model.aggregate.GroupBuyOrderAggregate;
import icu.feigroup.domain.trade.model.aggregate.GroupBuyTeamSettlementAggregate;
import icu.feigroup.domain.trade.model.entity.GroupBuyActivityEntity;
import icu.feigroup.domain.trade.model.entity.GroupBuyTeamEntity;
import icu.feigroup.domain.trade.model.entity.MarketPayOrderEntity;
import icu.feigroup.domain.trade.model.entity.NotifyTaskEntity;
import icu.feigroup.domain.trade.model.valobj.GroupBuyProgressVO;

import java.util.List;

/**
 * projectName:icu.feigroup.domain.trade.adapter.repository
 *
 * @author 飞
 * @since 2025/2/22 22:12
 * description:
 */
public interface ITradeRepository {
    MarketPayOrderEntity queryPayMarketPayOrderByOutTradeNo(String userId, String outTradeNo);

    GroupBuyProgressVO queryGroupBuyProgress(String teamId);

    MarketPayOrderEntity lockMarketPayOrder(GroupBuyOrderAggregate groupBuyOrderAggregate);

    GroupBuyActivityEntity queryGroupBuyActivityByActivityId(Long activityId);

    Integer queryOrderCountByActivityId(Long activityId, String userId);

    GroupBuyTeamEntity queryGroupBuyTeamByTeamId(String teamId);

    boolean settlementMarketPayOrder(GroupBuyTeamSettlementAggregate groupBuyTeamSettlementAggregate);

    boolean isSCBlackIntercept(String source, String channel);

    MarketPayOrderEntity queryMarketPayOrderEntityByOutTradeNo(String userId, String outTradeNo);

    int updateNotifyTaskStatusSuccess(String teamId);

    int updateNotifyTaskStatusError(String teamId);

    int updateNotifyTaskStatusRetry(String teamId);

    List<NotifyTaskEntity> queryUnExecutedNotifyTaskList();
    List<NotifyTaskEntity> queryUnExecutedNotifyTaskList(String teamId);
}
